#ifndef REPORTDIALOG_H
#define REPORTDIALOG_H

#include <QDialog>
#include "studyrecord.h"
class QPrinter;

namespace Ui {
class ReportDialog;
}

class ReportDialog : public QDialog
{
    Q_OBJECT

public:
    explicit ReportDialog(const StudyRecord &rec, QWidget *parent = 0);
    ~ReportDialog();

    void setStudyRecord(const StudyRecord &rec) { m_rec = rec; }
    void setReportImages(const QImage &axial, const QImage &coronal, const QImage &sagittal)
    { m_axial = axial; m_coronal = coronal; m_sagittal = sagittal; }
    void setSVMScore(const double &svmScore) { m_svmScore = svmScore; }

signals:
    void sendMail();
    void reportProgress(int value);

protected slots:
    void on_exportButton_clicked();
    void on_previewButton_clicked();
    void on_printButton_clicked();

    void on_mailFinished(bool ok, const QString &msg);
    void on_mailProgress(int value);
    void on_reportProgress(int value);

    void doPrint(QPrinter *printer);

private:
    Ui::ReportDialog *ui;

    StudyRecord m_rec;
    QImage m_axial;
    QImage m_coronal;
    QImage m_sagittal;
    double m_svmScore;
};

#endif // REPORTDIALOG_H
